<?php
namespace app\services;

use app\utils\Functions as F;
use app\utils\Upload as Up;

class CreativeTemplateService extends BaseService {
    public $matrix = [
        'id'            => 'id',
        'name'          => ['code', 'return htmlspecialchars($v);'],
        'template'      => 'name',
        'modifiedDate'  => 'last_update',
        // 'operate'       => ['id', 'return "edit, view";'],
        // 'creativeType'  => ['id', 'return \Yii::t("creative-template", "web creative template");'],
        // 'type'          => ['id', 'return \Yii::t("creative-template", "Mobile");'],
    ];

    public function getAllTemplateList() {
        $templates = $this->getAll('CreativeTemplate', ['is_sl' => 1]);
        return $this->fieldsMap($this->matrix, $templates);
    }

}//end

